package com.server.data;

import java.util.ArrayList;

import com.bean.BResource;
import com.bean.Client;
import com.bean.Course;
import com.bean.Grade;
import com.bean.PayLogs;

public class PrintData {
	public static void printClient(ClientData data) {
		Client client = data.getClient();
		System.out.println("id" + client.getAvailablEmoney());
		System.out.println("clientName=" + client.getClientName());
		System.out.println("clientTelnumber=" + client.getClientTelnumber());
		System.out.println("clientAddress=" + client.getClientAddress());
		System.out.println("availablEmoney=" + client.getAvailablEmoney());
		System.out.println("clientEmail=" + client.getClientEmail());
		System.out.println("clientCreatedate=" + client.getClientCreatedate().getTime());
		System.out.println("clientRemark=" + client.getClientRemark());
		System.out.println("clientIsactivate=" + client.getClientIsactivate());
		
	}
	
	public static void printPaylog(PayLogData data) {
		ArrayList<PayLogs> list = data.getList();
		if(list == null) {
			System.out.println("数据为null");
			return;
		}
		
		for(int i = 0; i < list.size(); i++) {
			PayLogs payLogs = list.get(i);
			System.out.println(payLogs.getPayId());
			System.out.println(payLogs.getPayMoney());
			System.out.println(payLogs.getPayType());
			System.out.println(payLogs.getPayUser());
			System.out.println(payLogs.getPayDate().getTime());
		}
	}
	
	public static void printResource(ResourceData data) {
		System.out.println("打印语文消息：");
		Course chinese = data.getChinese();
		
		System.out.println(chinese.getCourseCode());
		System.out.println(chinese.getCourseId());
		System.out.println(chinese.getCourseName());
		System.out.println(chinese.getCourseRemark());
		ArrayList<Grade> list = chinese.getGrades();
		for(int i = 0; i < list.size(); i ++) {
			Grade grade = list.get(i);
			System.out.println(grade.getGradeId());
			System.out.println(grade.getGradeIsactivate());
			System.out.println(grade.getGradeName());
			System.out.println(grade.getGradeRemark());
			ArrayList<BResource> bList = grade.getbResource();
			for(int j = 0; j < bList.size(); j++) {
				BResource resource = bList.get(j);
				System.out.println(resource.getFileName());
				System.out.println(resource.getIspackage());
				System.out.println(resource.getResourceId());
				System.out.println(resource.getResourceisactivate());
				System.out.println(resource.getResourceIsold());
				System.out.println(resource.getResourceName());
				System.out.println(resource.getResourceNumber());
				System.out.println(resource.getResourcePrice());
				System.out.println(resource.getResourceRemark());
				System.out.println(resource.getResourceSpace());
//				System.out.println(resource.getResourceUrl());
			}
		}
		
		// 打印math消息
		System.out.println("打印数学消息：");
		chinese = data.getMath();
		System.out.println(chinese.getCourseCode());
		System.out.println(chinese.getCourseId());
		System.out.println(chinese.getCourseName());
		System.out.println(chinese.getCourseRemark());
		list =  chinese.getGrades();
		for(int i = 0; i < list.size(); i ++) {
			Grade grade = list.get(i);
			System.out.println(grade.getGradeId());
			System.out.println(grade.getGradeIsactivate());
			System.out.println(grade.getGradeName());
			System.out.println(grade.getGradeRemark());
			ArrayList<BResource> bList = grade.getbResource();
			for(int j = 0; j < bList.size(); j++) {
				BResource resource = bList.get(j);
				System.out.println(resource.getFileName());
				System.out.println(resource.getIspackage());
				System.out.println(resource.getResourceId());
				System.out.println(resource.getResourceisactivate());
				System.out.println(resource.getResourceIsold());
				System.out.println(resource.getResourceName());
				System.out.println(resource.getResourceNumber());
				System.out.println(resource.getResourcePrice());
				System.out.println(resource.getResourceRemark());
				System.out.println(resource.getResourceSpace());
//				System.out.println(resource.getResourceUrl());
			}
		}
		
		// 打印英语消息
		// 打印math消息
		System.out.println("打印英语消息：");
		chinese = data.getEnglish();
		System.out.println(chinese.getCourseCode());
		System.out.println(chinese.getCourseId());
		System.out.println(chinese.getCourseName());
		System.out.println(chinese.getCourseRemark());
		list =  chinese.getGrades();
		for(int i = 0; i < list.size(); i ++) {
			Grade grade = list.get(i);
			System.out.println(grade.getGradeId());
			System.out.println(grade.getGradeIsactivate());
			System.out.println(grade.getGradeName());
			System.out.println(grade.getGradeRemark());
			ArrayList<BResource> bList = grade.getbResource();
			for(int j = 0; j < bList.size(); j++) {
				BResource resource = bList.get(j);
				System.out.println(resource.getFileName());
				System.out.println(resource.getIspackage());
				System.out.println(resource.getResourceId());
				System.out.println(resource.getResourceisactivate());
				System.out.println(resource.getResourceIsold());
				System.out.println(resource.getResourceName());
				System.out.println(resource.getResourceNumber());
				System.out.println(resource.getResourcePrice());
				System.out.println(resource.getResourceRemark());
				System.out.println(resource.getResourceSpace());
//				System.out.println(resource.getResourceUrl());
			}
		}
	}
}
